# 2019-3-11 21:41
# 验证码实现， 复杂功能出现问题， 待解决
# -------------------------------- #
from PIL_.pil_ import pil

pil = pil(width=190, height=60)

pil.draw_text_rotate(font_path='UbuntuMono-B.ttf', num=3, a_font=True, A_font=True)
# pil.draw_text(font_path='UbuntuMono-B.ttf', num=4, a_font=True, A_font=True)
pil.draw_point(400)
pil.draw_arc(13)
pil.draw_line(6)
pil.draw_out()
























# ---------------------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------------------- #
# ----------------------------上下分别可独立运行！！！！！！！----------------------------------- #
# ---------------------------------------------------------------------------------------- #


# import random
# from PIL import Image, ImageDraw, ImageFont
#
# width = 200
# height = 60
#
# # 定义使用Image类实例化一个长为400px,宽为400px,基于RGB的(255,255,255)颜色的图片
# img_ = Image.new(mode='RGBA', size=(width, height), color=(255, 255, 255))
# # draw1 = ImageDraw.Draw(img1, mode='RGBA')
#
# # 实例化一支画笔
#
# # 定义字体
# font_path = 'UbuntuMono-B.ttf'
# font1 = ImageFont.truetype(font_path, 60)
#
# # 画文本
# for i in range(3):
#     global IMG
#     img0 = Image.new(mode='RGBA', size=(width, height), color=(255, 255, 255))
#     draw0 = ImageDraw.Draw(img0, mode='RGBA')
#
#     # number = str(random.randint(0, 9))
#     # A_font = chr(random.randint(65, 90))
#     # a_font = chr(random.randint(97, 122))
#     # # 数字，大写字母，小谢字母
#     # char1 = random.choice([number, A_font, a_font])
#     # print(char1)
#     # color1 = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
#     # draw0.text((0, 0), char1, color1, font=font1)
#
#     img1 = img0.rotate(random.uniform(-35, 35), Image.BILINEAR, translate=((i * 65) + 25, 0), center=(0, 0), expand=0)
#     if i == 0:
#         IMG = img1
#     else:
#         IMG = Image.composite(img1, IMG, img1)
#
# blank = Image.new(mode='RGBA', size=IMG.size, color=(255, ) * 3)
# IMG = Image.composite(IMG, blank, IMG)
# IMG.show()

